﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ACP.Business;
using ACP.DTO;
using System.Text;

namespace ACP.Web.UI
{
    public partial class acpMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindDynamicTestTypeMenu();
            }
        }

        public void BindDynamicTestTypeMenu()
        {
            List<examtype> lstExamType = ExamTypeLogic.getExamTypeList();

            StringBuilder sbMenus = new StringBuilder();

            for (int i=0;i<lstExamType.Count;i++)
            {
                if (lstExamType[i].status == true)
                {
                    sbMenus.Append(@"<li id ='" + lstExamType[i].title + "'>");
                    sbMenus.Append(@"<a href='Test.aspx?eid=1&tid=" + lstExamType[i].examtypeid + "'>" + lstExamType[i].title + "</a>");
                    sbMenus.Append(@"</li>");
                }
            }
            LiteralACPMenu.Text = sbMenus.ToString();

            sbMenus = sbMenus.Clear();

            for (int i = 0; i < lstExamType.Count; i++)
            {
                if (lstExamType[i].status == true)
                {
                    sbMenus.Append(@"<li id ='" + lstExamType[i].title + "'>");
                    sbMenus.Append(@"<a href='Test.aspx?eid=2&tid=" + lstExamType[i].examtypeid + "'>" + lstExamType[i].title + "</a>");
                    sbMenus.Append(@"</li>");
                }
            }
            LiteralPMPMenu.Text = sbMenus.ToString();


        }
    }
}